using System;
using System.Collections.Generic;
using System.Text;
using Habanero.Faces.Base;

namespace FireStarterModeller.UI
{
    public static class UIUtilities
    {
        public static int GetGridWidthToFitColumns(IGridBase grid)
        {
            int width = 0;
            if (grid.RowHeadersVisible)
            {
                width = grid.RowHeadersWidth;
            }
            foreach (IDataGridViewColumn column in grid.Columns)
            {
                if (column.Visible) width += column.Width;
            }
            return width;
        }
    }
}
